package me.luger.project.picc.service;

import me.luger.core.dao.nutz.service.BaseService;
import me.luger.project.picc.service.picc.TongjiService;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import me.luger.project.picc.entity.Insurance;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class InsuranceService extends BaseService<Insurance> {



    public InsuranceService(Dao dao) {
        super(dao);
    }

    public Insurance fetchByPid(String pid) {
        Insurance insurance = this.fetchOne(Cnd.where("pid","=",pid));
        return insurance;
    }

    public Insurance fetchByopenId(String openId) {
        Insurance insurance = this.fetchOne(Cnd.where("openId","=",openId).orderBy("id","desc"));
        return insurance;
    }
}
